<?php use_helper('Form') ?>
<input type="hidden" id="controler" value="<?php echo $controler ?>" />


<div style="padding-top: 15px;">
  <?php echo link_to('<< Pregled poruka', 'poruka/index') ?>
</div>

<div id="indicator" style="float:left; display: none;"><?php echo image_tag("ajax-loading_2.gif", array("alt" => __("Čuva se"))) ?></div>

<?php if(isset($error)) echo "<div class='error'><ul>$error </ul></div>"; ?>

<form id="registrationForm" action="" method="POST">
  <table class="form_holder">
    <tr>
      <th>
        <label class="txLabel"><?php echo __('Primaoci:') ?></label>
        <div style="clear: both;">
           <a href="javascript:check_all('registrationForm', 1)"> all</a><br />
           <a href="javascript:check_all('registrationForm', 0)"> none</a>
        </div>
      </th>
      <td>

        <select id="primaoci_main" name="primaoci_main" onchange="resetRazred(); razredMenu(); primaociTop();">
          <option value="0">Izaberi</option>
          <option value="<?php echo ProfilPeer::$tip['administrator'] ?>">Administratoru</option>
          <option value="<?php echo ProfilPeer::$tip['upravnik'] ?>">Upravniku</option>
          <option value="<?php echo ProfilPeer::$tip['operater'] ?>">Operateru</option>
          <option value="<?php echo ProfilPeer::$tip['profesor'] ?>">Profesoru</option>
          <option value="<?php echo ProfilPeer::$tip['roditelj'] ?>">Roditelj</option>
          <option value="<?php echo ProfilPeer::$tip['ucenik'] ?>">Učeniku</option>
        </select>

        <?php if (isset($skolas)) if(count($skolas) > 1){?>
        <select id="primaoci_skola" name="primaoci_skola" onchange="resetRazred(); razredMenu(); primaociTop();">
          <option value="n">Izaberi školu</option>
          <option value="0">Sve škole</option>
          <?php echo options_for_select($skolas) ?>
        </select>
        <?php } ?>

        <span id="razred_menu"></span>

        <div id="primaoci_top" class="checkboxes">
        </div>

        <div id="primaoci_bottom" class="checkboxes">
        </div>

      </td>
    </tr>
    <tr>
      <th><label class="txLabel"><?php echo __('Naslov') ?></label></th>
      <td><input name="naslov" id="naslov" maxlength="50" class="regInput" type="text" /></td>
    </tr>
    <tr>
      <th><label class="txLabel"><?php echo __('Tekst') ?></label></th>
      <td><textarea style="width:400px; height: 300px;" name="text" id="text" class="regInput"></textarea></td>
    </tr>
    <tr>
      <th><label class="txLabel">&nbsp;</label></th>
      <td><a id="dugme" onclick="send_poruka();" href="javascript: void(0)" class="button"><span>Pošalji</span></a><span id="complete"></span></td>
    </tr>
  </table>
</form>